import java.io.*;
import java.util.*;

public class Main {
	String input;
	String[] spInput;
	StringTokenizer st;
	BufferedReader br;
	StringBuilder sb;
	
	public Main() {
		br = new BufferedReader(new InputStreamReader(System.in));
		sb = new StringBuilder();
	}
	
	public static void main(String[] args) throws IOException {
		Main main = new Main();
		main.beginProcess();
	}

	void beginProcess() throws IOException {
		while((input = br.readLine()) != null) {
			spInput = input.split(" ");
			recursion(spInput.length - 1);
		}
		System.out.print(sb);
	}
	
	void recursion(int n) {
		if(n == 0) {
			sb.append(spInput[n] + "\n");
			return;
		} else {
			sb.append(spInput[n] + " ");
			recursion(n - 1);
		}
	}
	
}